/**
 * @auth: dmx
 * @time: 2021/4/29
 * @func: 有几个地方需要活得分辨率的高度
 * */
import { useEffect, useState } from 'react';

function useViewHeight(h: number, initH?: number) {
  const [height, setHeight] = useState<number>(initH || 400);
  useEffect(() => {
    if (window.screen.height > 900) {
      setHeight(h);
    }
  }, []);

  return {
    height,
    setHeight,
  };
}

export default useViewHeight;
